import axios from 'axios';
import './axiosSetting';
import {CURRENT_ENV,hostMap} from './config'

const HOST = hostMap[CURRENT_ENV];
class Http {
    get(serverName,url,params){
        const URL = `${HOST}/${serverName}/${url}`
        return axios.get(URL,params||'',{headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        },})
    }
    post(serverName,url,params){
        const URL = `${HOST}/${serverName}/${url}`
        return axios.post(URL,params||{},{headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        },})
    }
}
export default new Http();